projects
/
babl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d82f74a
)
hash-table: simplify integer hashing
author
Øyvind Kolås
<pippin@gimp.org>
Sat, 31 Dec 2016 18:15:29 +0000
(19:15 +0100)
committer
Øyvind Kolås
<pippin@gimp.org>
Sat, 31 Dec 2016 18:15:29 +0000
(19:15 +0100)
babl/babl-hash-table.c
patch
|
blob
|
history
diff --git
a/babl/babl-hash-table.c
b/babl/babl-hash-table.c
index d507cb228141d19264e52983cb4103aabf53e7e5..e1c2e56088dede1485eae17cc2c0d4ab08a3b49b 100644
(file)
--- a/
babl/babl-hash-table.c
+++ b/
babl/babl-hash-table.c
@@
-58,15
+58,11
@@
babl_hash_by_int (BablHashTable *htab,
int id)
{
int hash = 0;
- int i;
-
- for (i = 0; i < sizeof (int); i++)
- {
- hash += id & 0xFF;
- hash += (hash << 10);
- hash ^= (hash >> 6);
- id >>= 8;
- }
+ hash += id & 0xFF;
+ hash += (hash << 10);
+ hash ^= (hash >> 6);
+ id >>= 8;
+ hash += id & 0xFF;
hash += (hash << 3);
hash ^= (hash >> 11);
hash += (hash << 15);